package com.bootdo.common.exception;

/**
 * @author junqiang.wang
 * @ClassName ResultType
 * @Description 返回结果码
 * @Company: www.eloancn.com
 * @date 2016/9/21 15:08
 */

public enum Direction {


    INCREASE(1,"增"),
    REDUCE(2,"减"),
    FROZEN(3,"冻结"),
    UNFROZEN(4,"解冻");
    private Integer code;
    private String msg;

    Direction(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Direction getDirection(Integer code) {
        for (Direction t : Direction.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
